<%@ page language="java" contentType="text/html; charset=UTF8"
    pageEncoding="UTF8"%>
    
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>  
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF8">
    <title>Questionnaires</title>  
<link rel="stylesheet" type="text/css" href="common/css/allArticle.css">
</head>
<body>
<div class="product-header-content">
		<div class="logo">
			<img src="common/images/logoLeft.png">
		</div>
		<div class="logoRight">
		<img src="common/images/logoRight.png">
		</div>
</div>
<div class="buttonlist">
<button type="button" class="btn7" value="Add" onclick="window.location.href='toAddQuestionnaire.action'" >增&nbsp;&nbsp;加</button>
<a href="allQuestionnaireByCategory.action?number=1&category=1">人口普查问卷</a>
<a href="allQuestionnaireByCategory.action?number=1&category=2">上班路线问卷</a>
<a href="allQuestionnaireByCategory.action?number=1&category=3">业余时间问卷</a>
<a href="allQuestionnaire.action?number=1">显示所有</a>
	<!-- <button type="button" class="btn6" id="back"  onclick="window.location.href='Announcements.action'">返&nbsp;&nbsp;&nbsp;回</button> -->
</div>
<table border="1"  class="datalist" >  
        <tbody>  
        <caption class="title" style="margin-left: 32px;font-size=20px">Article List</caption> 
            <tr>  
                <th>ID</th>  
                <th class="altrow" style="width:400px">NAME</th>  
                <th class="altrow">DEADLINE</th>
                <th class="altrow">STATUS</th>
                <th class="altrow">CATEGORY</th>
                <th>ACTION</th>
            </tr>  
            <c:if test="${!empty questionnaireList }">  
                <c:forEach items="${questionnaireList}" var="questionnaire">  
                    <tr>  
                        <td>${questionnaire.questionnaireId }</td>  
                        <td style="width:400px;font-weight:bold">${questionnaire.questionnaireName }</td>
                        <td>${questionnaire.questionnaireDeadline }</td>  
                        <td>${questionnaire.questionnaireStatus }</td>  
                        <td>${questionnaire.questionnaireCategory }</td>  

                        <td>  
                        <button type="button" class="btn4" id="back" onclick= "window.location='toEditQuestionnaire.action?questionnaireId=${questionnaire.questionnaireId}'">修&nbsp;&nbsp;改</button> 
                        <button type="button" class="btn5" id="back" onclick= "window.location='deleteQuestionnaire.action?questionnaireId=${questionnaire.questionnaireId}'">删&nbsp;&nbsp;除</button>        
                        </td>  
                    </tr>               
                </c:forEach>  
            </c:if>  
        </tbody>  
    </table>
    <div class="navi" style="width: 260px;margin: 0 auto;padding-top: 20px;">
    	<a href="allQuestionnaireByCategory.action?number=1&category=${sessionScope.category}">首页</a>
		<a href="allQuestionnaireByCategory.action?number=${sessionScope.number-1}&${sessionScope.category}">上一页</a>
		<a href="allQuestionnaireByCategory.action?number=${sessionScope.number+1}&${sessionScope.category}">下一页</a>
		<a href="allQuestionnaireByCategory.action?number=${sessionScope.count}&${sessionScope.category}">尾页</a>
		<font>当前第${sessionScope.number}/${sessionScope.count}</font>
	</div>
</body>
</html>